<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/include.inc.jsp" %>
<style>

    .rights ul {
        margin: 0;
        padding: 10px 0;
    }

    .rights p {
        margin: 0;
        padding: 10px 0px 0px;
    }

    .rights ul li {
        width: 15%;
        float: left;
    )
</style>

<div class="panelBar">
    <ul class="toolBar">
        <li><a class="delete" href="/admin/gorupManager!delGorupManager?gorupManager.id=${gorupManager.id}" target="ajaxTodo"
               title="确定要删除吗?<br>如果删除该用户组，会删除旗下的权限。<br>所属该组的员工将从新分配用户组<br>慎用！！！！！"><span>删除</span></a></li>
        <li><a class="edit" href="/admin/gorupManager!toAdd?gorupManager.id=${gorupManager.id}" target="dialog" title="用户组修改"
               rel="userNav"><span>修改</span></a></li>
        <li class="line">line</li>
    </ul>
</div>


<div class="pageContent sortDrag" selector="h1" layoutH="42">

   <%-- <div class="panel" defH="150">
        <h1>不可折叠面板1</h1>
    </div>--%>


    <form method="post" action="/admin/gorupManager!editResources" class="pageForm required-validate"
          onsubmit="return validateCallback(this, navTabAjaxDone)">
    <div class="panel collapse" minH="100" defH="250">
        <h1>${gorupManager.gorupName}-权限编辑</h1>
        <div>
            <input name="gorupManager.id" value="${gorupManager.id}" type="hidden"/>
            <%--
           <div class="rights">
               <p><b>销售管理权限</b></p>
               <ul>
                   <li>
                       <input type="checkbox" name="sales[]" value="销售列表:index"/>
                       销售列表
                   </li>
                   <li>
                       <input type="checkbox" name="sales[]" value="商品出库:sales"/>
                       商品出库
                   </li>
                   <li>
                       <input type="checkbox" name="sales[]" value="商品退货:return"/>
                       商品退货
                   </li>
               </ul>
           </div>
           <div class="divider"></div>--%>


            <c:forEach items="${list}" var="res">
                <c:if test="${res.parentId==0}">
                    <div class="rights">
                        <p><b>${res.resName}</b></p>
                        <ul>
                            <c:forEach items="${list}" var="ress">
                                <c:if test="${ress.parentId==res.id}">
                                    <li>
                                        <input type="checkbox" name="resList" value="${ress.id}"
                                                <c:forEach items="${resList}" var="gRes">
                                                    <c:if test="${gRes.resourcesId==ress.id}">
                                                        checked="true"
                                                    </c:if>
                                                </c:forEach>
                                                />${ress.resName}
                                    </li>
                                </c:if>
                            </c:forEach>
                        </ul>
                    </div>
                    <div class="divider"></div>
                </c:if>
            </c:forEach>

            <div class="formBar">
                <label style="float:left"><input type="checkbox" class="checkboxCtrl" group="resList"/>全选</label>
                <ul>
                    <li>
                        <div class="button">
                            <div class="buttonContent">
                                <button type="button" class="checkboxCtrl" group="resList" selectType="invert">反选</button>
                            </div>
                        </div>
                    </li>
                    <li>
                        <div class="buttonActive">
                            <div class="buttonContent">
                                <button type="submit">提交</button>
                            </div>
                        </div>
                    </li>
                </ul>
            </div>
        </div>
    </div>
    </form>

    <div class="panel collapse" minH="100" defH="150">
        <h1>${gorupManager.gorupName}-旗下员工 </h1>
        <div>
         <%--   <div class="divider"></div>
            <div class="panelBar">
                <ul class="toolBar">
                    <li><a class="edit" href="#"><span><b>${gorupManager.gorupName}</b>-旗下员工</span></a>
                    </li>
                </ul>
            </div>--%>

            <div class="pageContent">
                <div class="panelBar">
                    <ul class="toolBar">
                        <li><a class="add" href="/management!toAdd?user.positionId=${gorupManager.id}" target="dialog"
                               title="用户添加"><span>添加</span></a></li>
                        <li><a class="delete" href="/management!deleteUser?user.id={sid_user}" target="ajaxTodo"
                               title="确定要删除吗?"><span>删除</span></a></li>
                        <li><a class="edit" href="/management!toAdd?user.id={sid_user}" target="dialog" title="用户修改"
                               rel="userNav"><span>修改</span></a></li>
                        <li class="line">line</li>
                    </ul>
                </div>
                <table class="table" width="100%" layoutH="138">
                    <thead>
                    <tr>
                        <th width="20"></th>
                        <th width="100">员工姓名</th>
                        <th width="100">员工账号</th>
                        <th width="50">性别</th>
                        <th width="100">联系电话</th>
                        <th width="80">qq号码</th>
                        <th width="80">邮件</th>
                        <th width="auto">住址</th>
                        <th width="80">岗位名称</th>
                        <th width="100">身份证号码</th>
                        <th width="80">入职时间</th>
                        <th width="80">状态</th>
                    </tr>
                    </thead>
                    <tbody>

                    <c:forEach items="${userList}" var="user" varStatus="index">
                        <tr target="sid_user" rel="${user.id}">
                            <td>${index.index+1}</td>
                            <td>${user.ename}</td>
                            <td>${user.username}</td>
                            <td>${user.sex}</td>
                            <td>${user.phone}</td>
                            <td>${user.qq}</td>
                            <td>${user.email}</td>
                            <td>${user.address}</td>
                            <td>${user.positionName}</td>
                            <td>${user.idCard}</td>
                            <td>${user.inductionDate}</td>
                            <td>
                                <c:choose>
                                    <c:when test="${user.status==0}">
                                        在职
                                    </c:when>
                                    <c:otherwise>
                                        离职
                                    </c:otherwise>
                                </c:choose>
                            </td>
                        </tr>
                    </c:forEach>
                    </tbody>
                </table>
                <div class="panelBar">
                    <div class="pages">
                        <span>显示</span>
                        <select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
                            <option value="20">20</option>
                            <option value="50">50</option>
                            <option value="100">100</option>
                            <option value="200">200</option>
                        </select>
                        <span>条，共${totalCount}条</span>
                    </div>

                    <div class="pagination" targetType="navTab" totalCount="200" numPerPage="20" pageNumShown="10"
                         currentPage="1"></div>

                </div>
            </div>
        </div>
    </div>

</div>
